#!/bin/bash
cd "$1"
x="1024";

if [ "$#" = "2" ]; then
x="$2";
fi

for plik in `ls *.JPG`
do
convert $plik -geometry "$x"x"$x" -flatten -quality 75 a_$plik
jhead -autorot a_$plik > /dev/null 2>&1
done 
google picasa post --title "Zdjecia" a*.JPG
